//将拦截器整体导入
import request from '@/CommonJs/Interceptor'//导入已经写好的拦截器
import axios from 'axios'
// 封装所有的API接口

export function Login(params) {
  console.log(params)
  return request({
    url: '/administrator/login',
    method: 'post',
    params: params,
  })
}
const urlBase = 'http://121.196.151.181:4141/his/'
export function getListFun(url, params) {
  return axios({
    url: urlBase + url,
    method: 'get',
    params
  })
}
export function getListMoreFun(url, params){
  return axios({
    url: urlBase + url,
    method: 'post',
    params
  })
}

export function getTotalFun(url, keywords) {
  return axios({
    url: urlBase + url,
    method: 'post',
    params: {
      keywords
    }
  })
}

export function deleteByIdsFun(url, data) {
  return axios({
    url: urlBase + url,
    method: 'post',
    data
  })
}

export function deleteByIdFun(url,id){
  return axios({
    url:urlBase + url,
    method: 'post',
    params:{id}
  })
}

export function deleteByIdFun1(url,id){
  return axios({
    url:urlBase + url,
    method: 'post',
    data:{id}
  })
}

export function addFun(url,params){
  return axios({
    url:urlBase + url,
    method: 'post',
    params
  })
}
export function addBodyFun(url,data){
  return axios({
    url:urlBase + url,
    method: 'post',
    data
  })
}

export function updateFun(url,data){
  return axios({
    url:urlBase + url,
    method: 'post',
    data
  })
}
//以下为后添加的api方法
export function getRequerstById(url,data){
  return axios({
    url:urlBase + url,
    method: 'post',
    data
  })
}
export function getListFunPro(url, data) {
  return axios({
    url: urlBase + url,
    method: 'get',
    data //
  })
}
export function getListMoreFunPro(url, data){
  return axios({
    url: urlBase + url,
    method: 'post',
    data //这个也改了
  })
}

export function deleteByIdFunPro(url,id){
  return axios({
    url:urlBase + url,
    method: 'post',
    data:{id} //将param 改为data
  })}
  
export function updateRole(url,obj){
  return axios({
    url:urlBase + url,
    method: 'post',
    data:{
      delMark:obj.delMark,
      id:obj.id,
      realName:obj.realName,
      ruleName:obj.ruleName,
      userID:obj.userID,
      week:obj.week
    }
  })

}

export function getUserRole(url,id){
  return axios({
    url:urlBase + url,
    method:'post',
    data:{
      "deptID":id
    }
  })
}